package demo.customer.security;

import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;

import lombok.extern.slf4j.Slf4j;

@Slf4j
@Configuration
@EnableWebSecurity
@EnableGlobalMethodSecurity(prePostEnabled = true)
public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
	
//	@Override
//	protected void configure(HttpSecurity http) throws Exception {
//		log.info("***********SecurityConfiguration:configure(HttpSecurity http)*****");
////		http
////		.formLogin()
////		.permitAll()		
////		.and()
////			.requestMatchers().antMatchers("/login", "/logout", "/oauth/authorize", "/oauth/confirm_access")
////		.and()
////		.authorizeRequests()				
////		.anyRequest().authenticated();
//		
//		http.authorizeRequests().antMatchers("/actuator/**").permitAll().and()
//		.authorizeRequests().anyRequest().authenticated();		
//	}
//	
//	@Override
//	public void configure(WebSecurity web) throws Exception {
//		log.info("***********SecurityConfiguration:configure(WebSecurity web)*****");
//		web.ignoring().antMatchers("/actuator/**");
//	}	
}
